<%@ page import="com.lsk.util.GlobalParameter" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018-11-07
  Time: 下午 6:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>我的</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="/layui-v2.2.5/layui/css/layui.css" />
    <link href="my/css/mui.css" rel="stylesheet" />
    <link href="my/css/index.css" rel="stylesheet" />
    <link href="my/css/iconfont.css" rel="stylesheet" />
    <link href="my/css/swiper.min.css" rel="stylesheet" />

    <script src="my/js/jquery-3.3.1.min.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="/layui-v2.2.5/layui/layui.js"></script>
    <script>
        var deviceWidth=$(window).outerWidth();
        if(deviceWidth>=640){
            $("html").css("font-size","100px");
        }else{
            $("html").css("font-size",deviceWidth/640*100+'px');
        }
    </script>
    <style>

        #myHeard{
            width: 1rem;
            height: 1rem;
            margin-left:2rem;
            margin-top: 0.5rem;
            border-radius:1rem
        }
        .hb_bg p{
            text-align: center;
        }
        .layui-bg-blue {
            background-color: #c33dce!important;
        }
    </style>
</head>
<body>


<script>
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: '${wxAuthorization.appid}', // 必填，公众号的唯一标识
        timestamp:${wxAuthorization.timestamp}, // 必填，生成签名的时间戳
        nonceStr: '${wxAuthorization.nonceStr}', // 必填，生成签名的随机串
        signature: '${wxAuthorization.signature}',// 必填，签名
        jsApiList: ['updateAppMessageShareData','updateTimelineShareData','hideMenuItems','showMenuItems','onMenuShareAppMessage','onMenuShareTimeline'] // 必填，需要使用的JS接口列表
    });

    wx.ready(function(){
        wx.onMenuShareAppMessage({
            title: '${activityInfo.name}', // 分享标题
            desc: '${activityInfo.transmitTitle}', // 分享描述
            link: 'http://<%=GlobalParameter.domain%>/mobileGroup/groupIndex?orgId=${member.orgId}&activityId=${member.activityId}&parentId=${member.id}&groupId=${groupId}', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: '${logoPath}', // 分享图标
            success:function(res) {
                //这里是回调函数
                //transmitFriend();
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });

        //自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容（1.4.0）
        wx.onMenuShareTimeline({
            title: '${activityInfo.transmitTitle}', // 分享标题
            link: 'http://<%=GlobalParameter.domain%>/mobileGroup/groupIndex?orgId=${member.orgId}&activityId=${member.activityId}&parentId=${member.id}&groupId=${groupId}', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: '${logoPath}', // 分享图标
            success: function(res) {
                //这里是回调函
                //transmitMoments();
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });

        wx.hideMenuItems({
            menuList: ['menuItem:share:qq','menuItem:share:weiboApp','menuItem:favorite','menuItem:share:facebook'
                ,'menuItem:share:QZone','menuItem:originPage','menuItem:readMode','menuItem:openWithQQBrowser'
                ,'menuItem:openWithSafari','menuItem:copyUrl'] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
        });
        wx.showMenuItems({
            menuList: ['menuItem:profile','menuItem:addContact'] // 要显示的菜单项，所有menu项见附录3
        });

    });
</script>




<div class="mui-content">
    <div class="main">
        <div class="head">
            <img src="${member.heardUrl}" style="border-radius:1rem">
            <div class="username">${member.name}</div>
            <div class="share" onclick="showPoster()">分享给好友</div>
        </div>

        <div class="btngroup">
            <a href="/mobileGroup/groupRefundLogs?orgId=${orgInfo.id}&activityId=${activityInfo.id}&parentId=${member.id}&groupId=${groupId}">退款记录></a>
            <a href="/mobileGroup/groupRebateLogs?orgId=${orgInfo.id}&activityId=${activityInfo.id}&parentId=${member.id}&groupId=${groupId}">返利红包></a>
        </div>
        <c:if test="${returnData.code != '111111'}">  <%--无购买数据--%>
            <!-- 我的团队 -->
         <c:choose>
             <c:when test="${returnData.code == '000001'}">
                 <div class="myteam">
                     <div class="teamtit"><img src="my/images/team.png" alt=""></div>
                     <!-- 轮播 -->
                     <div class="swiper-container">
                         <div class="swiper-wrapper">
                              <c:forEach items="${returnData.data.groupMembers}" var="members">
                                  <div class="swiper-slide">
                                      <a href="#">
                                          <img src="${members.heardUrl}" style="border-radius:1rem" />
                                          <span style="margin-top: 0.2rem;display: block;" >${members.name}</span>
                                      </a></div>
                              </c:forEach>

                         </div>
                         <!-- Add Pagination -->
                         <div class="swiper-pagination"></div>
                     </div>

                     <!-- Swiper JS -->
                     <script src="my/js/swiper.min.js"></script>
                     <!-- Initialize Swiper -->
                     <script>
                         var swiper = new Swiper('.swiper-container', {
                             autoplay:true,
                             slidesPerView:5,
                             spaceBetween: 30,
                             //     pagination: {
                             //     el: '.swiper-pagination',
                             //     clickable: true,
                             //       },
                         });
                     </script>
                     <!-- 轮播end -->
                     <div class="layui-progress layui-progress-big" lay-showPercent="true">
                         <div class="layui-progress-bar layui-bg-blue" lay-percent="${progress}"></div>
                     </div>
                     <div class="team-txt">${returnData.msg}</div>
                 </div>



             </c:when>
             <c:when test="${returnData.code == '000002'}">
                 <!-- 单独购买 -->
                 <div class="buy">
                     <div class="teamtit" style="margin:0.2rem auto -0.1rem;"><img src="my/images/buy.png" alt=""></div>
                     <div class="buy-item">
                         <div class="icon-head" ><img style="border-radius:50%;overflow: hidden;" src="${member.heardUrl}" alt=""></div>
                         <div class="buy-success" style="line-height:0;">
                             <div style="line-height:0.6rem;">${returnData.data.order.id}</div>
                             <div style="line-height:0.4rem;margin-top:-0.1rem;">${returnData.data.order.createTime}</div>
                         </div>

                         <div class="buy-price">¥${returnData.data.order.money/100}</div>
                     </div>
                 </div>
             </c:when>

             <c:otherwise>
                 <div class="bg"><p>暂无相关记录</p></div>
             </c:otherwise>
         </c:choose>

        </c:if>
        <!-- 底部导航 -->
        <nav class="mui-bar mui-bar-tab">
            <a href="/mobileGroup/groupIndex?orgId=${orgInfo.id}&activityId=${activityInfo.id}&parentId=${member.id}&groupId=${groupId}" class="mui-tab-item ">
                <span class="mui-icon iconfont icon-youhuiquan-fill"></span>
                <span class="mui-tab-label">首页</span>
            </a>
            <a href="/mobileGroup/groupGoMyInfo?orgId=${orgInfo.id}&activityId=${activityInfo.id}&parentId=${member.id}&groupId=${groupId}" class="mui-tab-item mui-active">
                <span class="mui-icon iconfont icon-user "></span>
                <span class="mui-tab-label">我的</span>
            </a>
        </nav>

    </div><!-- main -->
</div>
<script src="my/js/mui.js"></script>
<script type="text/javascript">
    mui.init()
</script>
<script>
    mui('body').on('tap','a',function(){document.location.href=this.href;});
</script>


<script>
    layui.use(['layer','element'], function(){
        var layer = layui.layer;
        var element = layui.element;
    });
    /*海报*/
    function showPoster() {
        var memberName="${member.name}";
        var heardUrl="${member.heardUrl}";
        var hbStr = '<div class="hb_bg">' +
            '<p class="hb_ts">扫一扫下方二维码即可参加活动</p ><img class="hb_ewm" src="/mobileGroup/groupMyShareQc?memberId=${member.id}&groupId=${groupId}"/><p class="hb_name">长按识别二维码</p ></div>'
        layui.use('layer', function() {
            var layer = layui.layer;
            layer.open({
                type: 1,
                title: false,
                skin: 'hb_box',
                content: hbStr,
                shadeClose: true,
                closeBtn:0,
                offset: ['2%','10%'],
                area: ['80%', '65%']
            })
        })
    }


</script>

</body>

</html>

